﻿using MainService.UISERVER;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Serialization;

namespace MyTest
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MyTest.MyResult re = new MyTest.MyResult();
            re.Code="1asdfasdf";
            re.Msg = "asdfasdfadsf";
            re.Keys = new List<string>();
            re.Keys.Add("AAAAA");
            re.Keys.Add("BBBBB");
            re.Type = "hello";
            XmlSerializer xs = new XmlSerializer(typeof(MyTest.MyResult));
            using(Stream sm=new MemoryStream())
            {
                xs.Serialize(sm,re);
                sm.Position = 0;
                StreamReader sr=new StreamReader(sm);
                string xml=sr.ReadToEnd();
            }

        }
    }

    
}
